package com.cx.mall.demo.config;

import com.cx.mall.demo.entity.Children;
import com.cx.mall.demo.entity.Dog;
import com.cx.mall.demo.entity.Person;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ContainerConfig {
    @Bean("dog1") // 创建对象，将返回的对象放入容器中
    public Dog dog(){
        return new Dog();
    }
//    @Bean
//    public Children children(){
//        return new Children();
//    }
    @Bean("p")
    public Person person(){
        Person person = new Person();
        person.setName("xz");
        return person;
    }
}
